<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>TPage登录</title>
<link rel="stylesheet" type="text/css" href="${Domain}common/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="${Domain}common/easyui/themes/icon.css">
<script type="text/javascript" src="${Domain}common/easyui/jquery.min.js"></script>
<script type="text/javascript" src="${Domain}common/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${Domain}common/easyui/locale/easyui-lang-zh_CN.js"></script>
 <link rel="shortcut icon" type="image/x-icon" href="${Domain}favicon.ico" />
</head>
<body>

<div class="easyui-window" title="系统登录" style="width:100%;max-width:420px;padding:30px 60px;" data-options="collapsible:false,minimizable:false,maximizable:false,closable:false">
       <form id="tpage-login" method="post">
         <div style="margin-bottom:10px">
            <input class="easyui-textbox" name="account" style="width:100%;height:40px;padding:12px" data-options="prompt:'账号',iconCls:'icon-man',iconWidth:38,required:true">
        </div>
        <div style="margin-bottom:20px">
            <input class="easyui-passwordbox" name="password"   style="width:100%;height:40px;padding:12px" data-options="prompt:'密码',iconCls:'icon-lock',iconWidth:38,required:true">
        </div>
        <div style="margin-bottom:20px">
            <input type="checkbox" checked="checked" name="save_login">
            <span>记住登录状态</span>
        </div>
        <div>
            <a href="#" class="easyui-linkbutton" onclick="submitForm()" data-options="iconCls:'icon-ok'" style="padding:5px 0px;width:100%;">
                <span style="font-size:14px;">登录</span>
            </a>
        </div>
         </form>
</div>


<script>
  function submitForm(){
      $.messager.progress();
      $('#tpage-login').form('submit', {
	    url:'${Domain}api/login',	
	    onSubmit: function(){
        
            var isValid = $(this).form('validate');
			if (!isValid){
				$.messager.progress('close');	
			}
		    return isValid;	
   		},   
	    success:function(data){
	       var json = eval('(' + data + ')');  // change the JSON string to javascript object
			if (json.status){
			 	
			 	location.href="${Domain}my";
						 				           					 				           
			}else
			{
				$.messager.alert('提示',json.msg,'error');
			}
				   
			$.messager.progress('close');
	    }
	});
  }
       
</script>
</body>
</html>